package com.spider.singleinstance;

public class Test {
    public static void main(String[] args) {
        //目标：设计单例类。
        A a1 = A.a;
        A a2 = A.a;
        System.out.println(a1 == a2);
        B b1 = B.getInstance();
        B b2 = B.getInstance();
        System.out.println(b1+"\n" + b2);
        System.out.println(b1 == b2);
    }
}
